package com.xggstudio.crm.ui.mvp.v;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;

import com.xggstudio.crm.R;
import com.xggstudio.crm.base.BaseActivity;

public class AddOrEditUserActivity extends BaseActivity {

    private Toolbar toolbar;

    private TextView bar_text;

    @Override
    protected int getLayout() {
        return R.layout.activity_add_or_edit_user;
    }

    @Override
    protected void init(Bundle savedInstanceState) {

        initView();

    }

    @SuppressLint("RestrictedApi")
    private void initView(){

        toolbar = (Toolbar) $(R.id.toolbar);

        bar_text = (TextView) $(R.id.bar_text);

        toolbar.setTitle("");

        bar_text.setText("新增用户");

        setSupportActionBar(toolbar);

        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDefaultDisplayHomeAsUpEnabled(true);

    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_add_cus,menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        switch (item.getItemId()){
            case R.id.menu_add:

                break;
            case android.R.id.home:
                finish();
                break;
        }

        return super.onOptionsItemSelected(item);
    }
}
